#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMdiArea>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void setupMenus();

    static MainWindow* getMainWindow() {
        return ts;
    }


private slots:
    void onUserManagementActionCliked();
    void onCheckinManagementActionCliked();
    void onJobManagementActionCliked();
    void onPowerManagementActionCliked();
    void onDormitoryManagementActionCliked();
    void onCheckinActionCliked();
    void onLoginActionCliked();

private:
    template <class WidgetType>
    QMdiSubWindow* createSubWindow(WidgetType* widget);

private:
    Ui::MainWindow *ui;

    QMenu *userManagementMenu;
    QMenu *checkinManagementMenu;
    QMenu *jobManagementMenu;
    QMenu *powerManagementMenu;
    QMenu *dormitoryManagementMenu;

    static MainWindow* ts;
};

#endif // MAINWINDOW_H
